<!DOCTYPE html>
<meta charset="utf-16">
<html>
<head>
    <title>Usability pizza</title>
    <!--Header links -->
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    <!-- jQuery -->
    <script src="jquery.min.js"></script>
    <!-- sort and filter -->
    <script src="jquery.fastLiveFilter.js"></script>
    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

    <!-- Optional theme -->
    <link rel="stylesheet" href="bootstrap-theme.min.css">

    <!-- Latest compiled and minified JavaScript -->
    <script src="bootstrap.min.js"></script>
</head>
<body>

<div id="wrapper">
<header>
    <!--<div class="logo">logo</div>-->
    <a href="index.html">
        <img src="i-takeaway%20logo.png" alt="Logo i-Takeaway">
    </a>
</header>

<nav>
    <p id="restaurant-display">Please choose restaurant</p>
    Menu
    <form method="get" action="restaurant-choice.html">
        <input type="hidden" name="restaurant" id="restaurant" value="">
        <input class="button" type="submit" value="Back">
    </form>
</nav>
<div id="search">
    <input type="search" id="search_input" placeholder="Type to filter">
</div>


    <form method="get" action="index.html">
    <ul id="dishes_list">
        <li><a href="#" onclick="copyToText(this);">Special Fried Rice	£<span class="pp">3.20</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="riceNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="riceNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="riceNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="riceNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Egg Fried Rice	£<span class="pp">2.90</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="eggNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="eggNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="eggNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="eggNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Chicken Chow Mein	£<span class="pp">3.20</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="meinNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="meinNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="meinNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="meinNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">King Prawn Chow Mein	£<span class="pp">3.60</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="kingNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="kingNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="kingNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="kingNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Plain Chow Mein	£<span class="pp">2.60</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="plainNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="plainNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="plainNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="plainNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Barbecued Chicken with Boiled Rice	£<span class="pp">3.40</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="boiledNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="boiledNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="boiledNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="boiledNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Vegetable Chow Mein	£<span class="pp">3.20</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="vegeNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="vegeNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="vegeNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="vegeNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Chicken & Sweetcorn Soup	£<span class="pp">2.70</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="sweetNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="sweetNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="sweetNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="sweetNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Chicken & Noodle Soup	£<span class="pp">2.10</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="noodleNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="noodleNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="noodleNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="noodleNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Yakisoba Chicken	£<span class="pp">5.00</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="yakisobaNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="yakisobaNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="yakisobaNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="yakisobaNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Miso Salmon	£<span class="pp">10.00</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="salmonNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="salmonNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="salmonNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="salmonNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Teriyaki Rib Eye Steaks	£<span class="pp">9.00</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="teriyakiNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="teriyakiNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="teriyakiNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="teriyakiNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Japanese Beef Stir-Fly	£<span class="pp">10.50</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="japaneseNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="japaneseNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="japaneseNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="japaneseNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Oyako Donburi	£<span class="pp">7.00</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="oyakoNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="oyakoNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="oyakoNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="oyakoNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Yakitori Don	£<span class="pp">11.50</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="yakitoriNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="yakitoriNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="yakitoriNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="yakitoriNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Japanese Okonomiyaki	£<span class="pp">9.40</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="okonomiyakiNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="okonomiyakiNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="okonomiyakiNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="okonomiyakiNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Soba with Toasted	£<span class="pp">12.00</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="toastedNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="toastedNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="toastedNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="toastedNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Quick Oyakodon	£<span class="pp">6.50</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="quickNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="quickNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="quickNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="quickNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Juicy Chicken	£<span class="pp">7.50</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="juiceNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="juiceNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="juiceNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="juiceNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Medium Lamb Curry	£<span class="pp">7.99</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="lambNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="lambNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="lambNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="lambNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Saag Ghost	£<span class="pp">5.99</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="saagNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="saagNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="saagNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="saagNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Lamb Jalfrezi	£<span class="pp">8.99</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="jalfreziNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="jalfreziNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="jalfreziNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="jalfreziNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Chicken Biryani	£<span class="pp">6.50</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="biryaniNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="biryaniNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="biryaniNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="biryaniNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Mixed Vegetables	£<span class="pp">10.00</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="mixedNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="mixedNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="mixedNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="mixedNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Aloo Chana	£<span class="pp">5.99</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="alooNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="alooNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="alooNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="alooNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Egg Curry	£<span class="pp">3.99</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="curryNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="curryNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="curryNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="curryNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Pappadums	£<span class="pp">4.99</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="pappadumsNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="pappadumsNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="pappadumsNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="pappadumsNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Samosa	£<span class="pp">2.50</span></a><span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="samosaNum">                   <span class="glyphicon glyphicon-minus"></span>               </button>           </span>             <input type="number" class="input-number" name="samosaNum" value="0" min="0" max="20">                 <span class="input-group-btn">               <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="samosaNum">                   <span class="glyphicon glyphicon-plus"></span>               </button>               <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="samosaNum">                   <span class="glyphicon glyphicon-remove"></span>               </button>           </span></li>
        <li><a href="#" onclick="copyToText(this);">Pizza	£<span class="pp">7.99</span></a>
        <span class="input-group-btn">
              <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="pizzaNum">
                  <span class="glyphicon glyphicon-minus"></span>
              </button>
          </span>
            <input type="number" class="input-number" name="pizzaNum" value="0" min="0" max="20">
                <span class="input-group-btn">
              <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="pizzaNum">
                  <span class="glyphicon glyphicon-plus"></span>
              </button>
              <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="pizzaNum">
                  <span class="glyphicon glyphicon-remove"></span>
              </button>
          </span>
        </li>
        <li><a href="#" onclick="copyToText(this);">Pasta	£<span class="pp">8.99</span></a>
     <span class="input-group-btn">
              <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="pastaNum">
                  <span class="glyphicon glyphicon-minus"></span>
              </button>
          </span>
            <input type="number" class="input-number" name="pastaNum" value="0" min="0" max="20">
                <span class="input-group-btn">
              <button type="button" class="btn btn-default btn-number" data-type="plus" data-field="pastaNum">
                  <span class="glyphicon glyphicon-plus"></span>
              </button>
              <button type="button" class="btn btn-default btn-number" data-type="remove" data-field="pastaNum">
                  <span class="glyphicon glyphicon-remove"></span>
              </button>
          </span>
        </li>
    </ul>
    <table>
        <tr>
            <td>Food charge:</td>
            <td class="right"><span id="food">&pound; 0.00</span></td>
        </tr>
        <tr>
            <td>Delivery charge:</td>
            <td class="right"><span id="delivery">&pound; 2.00</span></td>
        </tr>
        <tr>
            <td>Total price:</td>
            <td class="right"><span id="total">&pound; 0.00</span></td>
        </tr>
    </table>
        <input type="checkbox" name="tandc" id="tandc" required="true"><label for="tandc"> Terms and Conditions </label><br/>
    <input type="submit" value="Proceed">
</form>

<div id="footer"></div>
   </div>
</body>

<script>
    $(function () {
        $('#search_input').fastLiveFilter('#dishes_list');
    });
</script>

<script>
    function getQueryParams(qs) {
        qs = qs.split("+").join(" ");
        var params = {},
                tokens,
                re = /[?&]?([^=]+)=([^&]*)/g;

        while (tokens = re.exec(qs)) {
            params[decodeURIComponent(tokens[1])]
                    = decodeURIComponent(tokens[2]);
        }

        return params;
    }

    var $_GET = getQueryParams(document.location.search);
    ;
    var restaurant = $_GET["restaurant"];
    if (restaurant != undefined) {
        restaurant = restaurant.charAt(0).toUpperCase() + restaurant.substr(1);
        $('#restaurant').val(restaurant);
        $('#restaurant-display').text(restaurant);
    }
</script>

<script>
    function copyToText(listele) {
        dish = listele.text.replace(/^\s+|\s+$/g, '');
        ;
        $('#search_input').val(dish);
    }

</script>

<script>
    $('.btn-number').click(function (e) {
        e.preventDefault();

        var fieldName = $(this).attr('data-field');
        var type = $(this).attr('data-type');
        var input = $("input[name='" + fieldName + "']");
        var currentVal = parseInt(input.val());
        if (!isNaN(currentVal)) {
            if (type == 'minus') {

                if (currentVal > input.attr('min')) {
                    input.val(currentVal - 1).change();
                }
                if (parseInt(input.val()) == input.attr('min')) {
                    $(this).attr('disabled', true);
                }
            }
            else if (type == 'remove') {
                input.val(0).change();
                var buttons = $('.btn-number');
                for (var i = 0; i < buttons.length; i++) {
                    var button = buttons[i];
                    if (button.getAttribute('data-field') == fieldName) {
                        if (button.getAttribute('data-type') == 'minus') {
                            button.setAttribute('disabled', true);
                        }
                    }
                }
                /*
                 <button type="button" class="btn btn-default btn-number" disabled data-type="minus" data-field="pastaNum">
                 <span class="glyphicon glyphicon-minus"></span>
                 </button>
                 */
            }
            else if (type == 'plus') {
                if (currentVal < input.attr('max')) {
                    $(this).attr('disabled', false);
                    input.val(currentVal + 1).change();
                }
                if (parseInt(input.val()) == input.attr('max')) {
                }

            }
        } else {
            input.val(0);
        }
        var sum = 0.00;
        //recalculate the price in total so that the price is up to date
        /*
         iterate over each list item
         get price and count
         add to total sum
         set total sum.
         */
        $("#dishes_list li").each(function () {
            var number = $(this).children('input').val();
            number = parseInt(number);
            var price = $(this).find('.pp').text();
            price = parseFloat(price);
            if(price == NaN){
                price = 0.00;
            }
            console.log("Price: "+price);
            sum = sum + number * price;
            console.log("Sum: "+sum);
            console.log("number: " +number);

        });
        $("#food").text("£ " + sum.toFixed(2));
        if (sum > 15) {
            $("#delivery").text("£ 0.00");
        } else if (sum == 0) {

        } else {
            $("#delivery").text("£ 2.00");
            sum = sum + 2;
        }
        $("#total").text("£ " + sum.toFixed(2));
    });

    $('.input-number').change(function () {
        minValue = parseInt($(this).attr('min'));
        maxValue = parseInt($(this).attr('max'));
        valueCurrent = parseInt($(this).val());

        name = $(this).attr('name');
        if (valueCurrent >= minValue) {
            $(".btn-number[data-type='minus'][data-field='" + name + "']").removeAttr('disabled')
        } else {
            alert('Sorry, the minimum value was reached');
            $(this).val($(this).data('oldValue'));
        }
        if (valueCurrent <= maxValue) {
            $(".btn-number[data-type='plus'][data-field='" + name + "']").removeAttr('disabled')
        } else {
            alert('Sorry, the maximum value was reached');
            $(this).val($(this).data('oldValue'));
        }


    });


</script>
</html>